package com.shwread.android.ui.widget;

import org.geometerplus.android.fbreader.ButtonsPopupPanel;
import org.geometerplus.android.fbreader.PopupWindow;
import org.geometerplus.fbreader.fbreader.FBReaderApp;

import android.widget.RelativeLayout;

import com.shwread.android.qysw.activity.ReadingBookActivity;

public final class TextSearchPopup extends ButtonsPopupPanel {
	public final static String ID = "TextSearchPopup";

	public TextSearchPopup(FBReaderApp fbReader) {
		super(fbReader);
	}

	@Override
	public String getId() {
		return ID;
	}

	@Override
	protected void hide_() {
		getReader().getTextView().clearFindResults();
		super.hide_();
	}

	@Override
	public void createControlPanel(ReadingBookActivity activity, RelativeLayout root) {
		if (myWindow != null && activity == myWindow.getActivity()) {
			return;
		}

		myWindow = new PopupWindow(activity, root, PopupWindow.Location.Bottom);

//		addButton(ActionCode.FIND_PREVIOUS, false, R.drawable.text_search_previous);
//		addButton(ActionCode.CLEAR_FIND_RESULTS, true, R.drawable.text_search_close);
//		addButton(ActionCode.FIND_NEXT, false, R.drawable.text_search_next);
	}
}
